<?php
namespace Core\CoreContracts;

/*
* Category definition
*/
class Category 
{
	/**
    * @property integer $Id The category unique identifier
    */
	public $Id;
	
	/**
    * @property Account $Account The associated account
    */
	public $Account;
	
	/**
    * @property string $Name The category name
    */
	public $Name;
	
	/**
    * @property Category $ParentCategory The parent category
    */
	public $ParentCategory;
	
	/**
    * @property string $Path The category path
    */
	public $Path;
	
	/**
    * @property datetime $ModificationDate The category modification date
    */
	public $ModificationDate;
	
	/**
    * @property datetime $ModificationDate The category creation date
    */
	public $CreationDate;
	
	/**
	* The default constructor
	*/
	public function __construct()  {  }
	
	/*
	* Build a new category object
	*
	* @param Account $account The associated account
	* @param string $name The category name
	* @param Category $parent The parent category
	* @param string $path The category path
	*/
	public static function Create($account, $name, $parent, $path)
	{
		$category = new Category();
		$category->Account = $account;
		$category->Name = $name;
		$category->ParentCategory = $parent;
		$category->Path = $path;	
		$category->ModificationDate = date("Y-m-d H:i:s");
		$category->CreationDate = date("Y-m-d H:i:s");
		return $category ;
	}
}
?> 